<?php

/**
 * Example usage of HTTP_Request_SaveAs class
 *
 * @author Philippe Jausions <Philippe.Jausions@11abacus.com>
 */

require_once 'HTTP/Request.php';
require_once 'HTTP/Request/SaveAs.php';

$http = new HTTP_Request('http://www.php.net/');

// These are the default options
$options = array(
//    'saveHeaders' => false,
//    'saveBody' => true,
//    'httpStatus' => array(200),
);
$saver = new HTTP_Request_SaveAs(null, $options);

$http->attach($saver);

$http->sendRequest(false);

// The filename the content was downloaded to
echo $saver->file;

?>